<template>
  <div>
    <el-container>
      <el-header style="height:80px">
        <el-row>
          <el-col :span="3" id="kong">
            <el-col :span="5" id="kong"></el-col>
            <el-col :span="16">
              <h3>餐饮系统</h3>
            </el-col>
          </el-col>
          <el-col :span="1">
            <div class="demo-basic--circle">
              <div class="block">
                <el-avatar :size="53" :src="circleUrl"></el-avatar>
              </div>
            </div>
          </el-col>
          <el-col :span="8" id="header2">
            <div class="Mid ">
              <div class="clear">
                <div class="idname">
                  <p>{{username}}</p>
                </div>
                <div class="idbtn">
                  <el-button plain @click="onQuit">退出登录</el-button>
                </div>
              </div>
              <div id="yuangong">
                <p>员工ID：{{userid}}</p>
                <el-col :span="12" id="dakai">
                  <el-dropdown trigger="click">
                    <span class="el-dropdown-link">
                      <i class="el-icon-arrow-down el-icon--right"></i>
                    </span>

                    <el-dropdown-menu slot="dropdown">
                      <el-descriptions direction="horizontal" :size="size" :column='1' :colon='false'>
                        <el-descriptions-item label="用户名:">{{form.user_name}}</el-descriptions-item>
                        <el-descriptions-item label="账号:">{{form.user_tel}}</el-descriptions-item>
                        <el-descriptions-item label="门店:">{{form.user_company}}</el-descriptions-item>
                        <el-descriptions-item label="地址:">{{form.user_address}}</el-descriptions-item>

                        <el-descriptions-item>
                          <el-button type="primary" class="btn1" @click="$router.push('/employee/systememployee/basic')">修改信息
                          </el-button>
                        </el-descriptions-item>

                      </el-descriptions>
                    </el-dropdown-menu>
                  </el-dropdown>
                </el-col>
              </div>
            </div>
          </el-col>
        </el-row>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-row class="tac">
            <el-col :span="24">
              <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" background-color="#FFFFFF" text-color="#333333" :router="true">
                <el-menu-item index="/manage/homepage">
                  <span slot="title">首页</span>
                </el-menu-item>
                <el-menu-item index="/manage/food">
                  <span slot="title">菜品</span>
                </el-menu-item>
                <el-submenu index="/manage/inventory">
                  <template slot="title">
                    <span>库存</span>
                  </template>
                  <el-menu-item-group>
                    <el-menu-item index="/manage/inventory/foodstock">菜品库存</el-menu-item>
                    <el-menu-item index="/manage/inventory/fstocktaking">库存盘点</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>
                <el-submenu index="/manage/promotion">
                  <template slot="title">
                    <span>促销</span>
                  </template>
                  <el-menu-item-group>
                    <el-menu-item index="/manage/promotion/coupon">优惠券管理</el-menu-item>
                    <el-menu-item index="/manage/promotion/product">促销商品</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>
                <el-menu-item index="/manage/indent">
                  <span slot="title">订单</span>
                </el-menu-item>
                <el-submenu index="/manage/report">
                  <template slot="title">
                    <span>报表</span>
                  </template>
                  <el-menu-item-group>
                    <el-menu-item index="/manage/report/foodwater">菜品流水</el-menu-item>
                    <el-menu-item index="/manage/report/cashierwater">收银流水</el-menu-item>
                    <el-menu-item index="/manage/report/revenuereport">店铺营收</el-menu-item>
                    <el-menu-item index="/manage/report/smallprogram">用户数据</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>
                <el-submenu index="/manage/system">
                  <template slot="title">
                    <span>系统</span>
                  </template>
                  <el-menu-item-group>
                    <el-submenu index="/manage/system/shop">
                      <template slot="title">
                        <span>门店配置</span>
                      </template>
                      <el-menu-item-group>
                        <el-menu-item index="/manage/system/shop/worker">员工设置</el-menu-item>
                        <el-menu-item index="/manage/system/shop/store">门店信息 </el-menu-item>
                        <el-menu-item index="/manage/system/shop/loginlog">员工登录日志</el-menu-item>
                      </el-menu-item-group>
                    </el-submenu>
                    <el-menu-item index="/manage/system/tablelist">桌位管理</el-menu-item>
                    <el-menu-item index="/manage/system/codeorder">扫码点餐配置</el-menu-item>
                    <el-menu-item index="/manage/system/pay">支付设置</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>
              </el-menu>
            </el-col>
          </el-row>
        </el-aside>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>


export default ({
  data: function () {
    return {
      circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
      form: {
        user_name: '',
        user_tel: '',
        user_company: '',
        user_address: ''
      },
      username: '',
      userid: '',
      size: 'small'
    }
  },
  mounted: function () {
    this.userid = JSON.parse(sessionStorage.getItem('user')).user_id
    this.username = JSON.parse(sessionStorage.getItem('user')).user_name
    this.form = JSON.parse(sessionStorage.getItem('user'))

    // this.name=this.$route.params.user;
  },
  methods: {
    handleOpen() {
      console.log(1)
    },
    handleClose() {
      console.log(2);
    },

    onQuit() {
      this.$message({
        message: '退出成功',
        type: 'success',
        duration: 2000
      });
      this.$router.push({ path: '/login' })
    }
  }
})
</script>


<style lang="less" scoped>
.el-header {
  color: #333333;
  line-height: 80px;
  padding: 0;
  #touxiang {
    height: 80px;
    line-height: 80px;
    padding-left: 10px;
    img {
      height: 50px;
      vertical-align: middle;
      border-radius: 50%;
    }
  }
  h3 {
    font-size: 25px;
  }
  #zuo {
    height: 80px;
    line-height: 80px;
    div {
      display: inline-block;
      vertical-align: middle;
      p {
        font-size: 14px;
        height: 20px;
        line-height: 20px;
      }
    }
  }
}
#kong {
  height: 1px;
}
.el-aside {
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  color: #333;
}
</style>

<style lang="less">
#header2 {
  margin-top: 15px;
  p {
    height: 25px;
    line-height: 25px;
  }
  #dakai {
    height: 25px;
  }
  .el-dropdown {
    height: 25px;
    float: left;
    line-height: 25px;
    .el-icon--right {
      float: left;
    }
  }

  .idbtn {
    float: left;
    height: 25px;
    margin-left: 35px;
    .el-button {
      width: 65px;
      height: 25px;
      line-height: 25px;
      padding: 0px;
      float: left;
    }
  }
  #yuangong {
    p {
      width: 116px;
      float: left;
    }
  }
  .idname {
    float: left;
  }
  .el-descriptions {
    width: 300px;
    padding-left: 10px;
  }
  .el-icon-arrow-down {
    margin-top: 5px;
  }
  .block {
    margin-top: 12px;
  }
}
</style>
